<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .nav {
            background-color: antiquewhite;
            width: 500px;
            height: 30px;
            margin: 20px auto;
        }
        .item {
            width: 125px;
            float: left;
            line-height: 30px;
            text-align: center;
        }
        #hide {
            visibility: hidden;
        }
    </style>
</head>
<body>
    <div class="nav">
        <div class="item">首页</div>
        <div class="item">个人主页</div>
        <div class="item">设置</div>
        <div class="item" id="hide"> 隐藏内容</div>
    </div>
    <script>
        var hideTest = document.getElementById('hide')
        console.log(hideTest.textContent)
        console.log(hideTest.innerText)
        hideTest.textContent = '特定时刻显示'
        console.log(hideTest.textContent)
    </script>
</body>
</html>